Add braces to prefetch_noexcept location var to fix clang-tidy reported error - #23066
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis change modifies the Changesprefetch.cpp fix
Estimated code review effort: 1 (Trivial) | ~3 minutes Related Issues: None specified Related PRs: None specified Suggested labels: bug, cuda-13 Suggested reviewers: None specified Poem: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
bdice
left a comment
There was a problem hiding this comment.
I guess that's fine but I don't see why it's needed.
|
I got curious about why this had changed. We updated the In CUDA 13.2, enum cudaMemLocationType type;
int id;In CUDA 13.3, it became: enum cudaMemLocationType type;
union {
int id;
}; |
| cudaMemLocation location{ | ||
| (device_id.value() == cudaCpuDeviceId) ? cudaMemLocationTypeHost : cudaMemLocationTypeDevice, | ||
| device_id.value()}; | ||
| {device_id.value()}}; |
There was a problem hiding this comment.
An alternative fix that should work with CUDA 13.0-13.2 or CUDA 13.3+ is this (untested):
| cudaMemLocation location{ | |
| (device_id.value() == cudaCpuDeviceId) ? cudaMemLocationTypeHost : cudaMemLocationTypeDevice, | |
| device_id.value()}; | |
| {device_id.value()}}; | |
| cudaMemLocation location{}; | |
| location.type = (device_id.value() == cudaCpuDeviceId) | |
| ? cudaMemLocationTypeHost | |
| : cudaMemLocationTypeDevice; | |
| location.id = device_id.value(); |
There was a problem hiding this comment.
This suggestion appears to be a "declare and delay initialization" anti-pattern which prevents location from being a constant variable.
|
Claude gave me this explanation:
|
|
/merge |
Description
Fixes a clang-tidy reported error:
Reference: https://github.com/rapidsai/cudf/actions/runs/28523775732/job/84555399492?pr=23031#step:13:1460
Checklist